﻿Chenxin.UI.CommunityMgr=Chenxin.extend(Chenxin.UI.PageCommon,{
	actionUrl:'service/CommunityMgr.ashx',
	createGrid:function(){			
		return new Chenxin.UI.ExpandGrid({
			actionUrl:this.actionUrl+'?op=getlist',
			id:'community',
			renderTo:'community_table',
			columns:{
				CommunityName:{
					head:'楼盘名称',
					width:130,
					sortable:true
				},
				Region:{
					head:'区域',
					width:80,
					sortable:true
				},
				Block:{
					head:'板块',
					width:60,
					sortable:true
				},
				Address:{
					head:'地址',
					width:130,
					sortable:true
				},
				CommunityUse:{
					head:'用途',
					width:60,
					sortable:true
				},
				BuildingType:{
					head:'类型',
					width:55,
					sortable:true
				},
				CompleteYear:{
					head:'竣工年份',
					width:70,
					sortable:true
				},
				AddTime:{
					head:'开盘时间',
					width:120,
					sortable:true
				},
				Status:{
					head:'状态',
					width:60,
					sortable:true,
					style:'text-align:center;'
				}
			},
			scope:this,
			rowExpandAble:true,
			rowExpand:function(dom,el,grid){
				dom.append('<div class="g_box"><div class="g_menu" style="margin-top:30px"><div class="wind120"><input type="button" class="btn_add" value="  添加栋号" id="btn_add_building"></div><div class="wind120"><input type="button" class="btn_add" value="  批量添加" id="btn_bulkadd_building"></div></div><div class="g_tab"><div id="communitybuilding_table"></div></div></div>');
				this.createHouseBuilding();
				this.buildIngMgr.grid.reload({
					communityid:this.currentId
				},true);	
				
			}
		});
	},
	loadHouseBuilding:function(){
		if(!this.currentId){
			alert('请先选择一条楼盘记录！')
			return;
		}
		$('#'+this.currentId).after('<tr id="tr_communitybuilding" n="'+this.currentId+'"><td colspan="10" class="gendan_box" valign="top" style="padding-top:5px;padding-left:5px; height:180px;" ><div class="g_box"><div class="g_menu" style="margin-top:30px"><div class="wind120"><input type="button" class="btn_add" value="  添加栋号" id="btn_add_building"></div><div class="wind120"><input type="button" class="btn_add" value="  批量添加" id="btn_bulkadd_building"></div></div><div class="g_tab"><div id="communitybuilding_table"></div></div></div></td></tr>');
		this.createHouseBuilding();
		this.buildIngMgr.grid.reload({
			communityid:this.currentId
		},true);	
	},
	createHouseBuilding:function(){
		if(!this.buildIngMgr){
			this.buildIngMgr=new Chenxin.UI.CommunityBuildingMgr({
				autoLoadGrid:false
			});
		}
		if(this.currentId){
			this.buildIngMgr.communityId=this.currentId;		
		}
	},
	bulkAdd:function(){
		if(!this.bulkForm){
			this.bulkForm=new Chenxin.UI.CommunityBulkAddForm({
				scope:this,
				saveSucc:function(){
					this.reloadGrid();
				}
			});
		}
		if(this.bulkForm.show()){
			this.bulkForm.fitData({
				CommunityName:'(*)',
				step:1,
				LengthNumber:1,
				Address:'(*)',
				setting:'number',
				MinNumber:'1',
				MaxNumber:'1',
				MinChar:'A',
				MaxChar:'Z'
			})
		}
	},
	
	/**
	*@description Ajax交互，对选中记录进行删除
	*/
	logicDel:function(autoConfirm,ch,confirmMsg,op){//删除操作
		if(!this.currentId){
			alert('请选择一条记录！');
			return;			
		}
	
		var _this=this;
		var d=true;
		if(autoConfirm){
			d=confirm(confirmMsg||'确定要删除该条记录吗？');
		}
        if(d){
			Chenxin.ajax({				
				type: "get",
				dataType: "json",
				url: this.actionUrl,
				data: {op:op||'logicdel',modelid:this.currentId,checkhouse:ch||'true'},
				onSuccess: function(data,msg) {
					if(data.hasHouse){
						if(confirm('本小区已经添加过房源，确定执行逻辑删除吗？')){
							_this.logicDel(false,'false');
						}
					}else{					
						alert(msg);
						if(_this.grid){
							_this.grid.reload();
						}
						if(_this.logicDelSucc){
							_this.logicDelSucc();
						}
					}
				}
			});
		}			
	},
	clearCach:function(){	
		var idList=this.grid.getSelectList();
		if(!idList){
			alert('请先选择楼盘记录！');
			return;
		}
		Chenxin.ajax({				
			type: "get",
			dataType: "json",
			url: this.actionUrl,
			data: {op:'clearcach',idList:idList},
			onSuccess: function(data,msg) {		
				alert(msg);
			}
		});
	},
	initEvent:function(){
		var _this=this;
		$('#btn_add').click(function(){
            _this.add();
			 _this.form.op='add';   
			_this.form.reset();
			return false;
		});	
		$('#btn_bulkadd').click(function(){
            _this.bulkAdd();
			return false;
		});	
		
		
		$('#btn_logicdel').click(function(){
            _this.logicDel(true);
			return false;
		});	
		$('#btn_lock').click(function(){
			var _status=_this.grid.getRecord('Status');
			if(_status=="已冻结"){
				alert('状态为“冻结”的楼盘，不能执行冻结操作！');
				return false;
			}else if(_status=="已删除"){			
				alert('状态为“已删除”的楼盘，不能执行冻结操作！');	
				return false;
			}
            _this.logicDel(true,'false','确定冻结该楼盘吗？该楼盘被冻结后将不能添加相同名称楼盘，且不能添加房源！','lock');
			return false;		
		});		
		$('#btn_unlock').click(function(){
			var _status=_this.grid.getRecord('Status');
			if(_status=="正常"){				
				alert('状态为“正常”的楼盘，不能执行激活操作！');
				return false;
			}else if(_status=="已删除"){				
				alert('状态为“已删除”的楼盘，不能执行激活操作！');
				return false;
			}
            _this.logicDel(true,'false','确定激活该楼盘吗？','unlock');
			return false;		
		});		
		
		
		$('#btn_del').click(function(){			        
            _this.del();
			return false;
        });
		
		$('#btn_edit').click(function(){
            _this.edit();
			return false;
        });

		$('#btn_export').click(function(){
            _this.exportData();
			return false;
        });	
		$('#btn_clearcach').click(function(){
            _this.clearCach();
			return false;
        });	
      
		$('#goon_addcomm').click(function(){			
			$('#addcomm_msg').jqmHide();
			_this.add();
			_this.form.reset();
			
		});
		$('#add_building').click(function(){		
			$('#addcomm_msg').jqmHide();
			
			_this.createHouseBuilding();
			_this.buildIngMgr.add();
			return false;
		});
		
		$('#a-add').live('click',function(){
			Chenxin.Msg.alert.hide();
			_this.add();
			_this.form.reset();			
		});
		$('#a-addbuilding').live('click',function(){	
			Chenxin.Msg.alert.hide();
			
			_this.createHouseBuilding();
			_this.buildIngMgr.form.reset();
			_this.buildIngMgr.add();
			return false;
		});
		$('#a-bulkaddbuilding').live('click',function(){	
			Chenxin.Msg.alert.hide();
			_this.createHouseBuilding();
			_this.buildIngMgr.bulkAdd();
			return false;
		});
		
	},
	createForm:function(){
		return new Chenxin.UI.CommunityBaseInfoForm({
			scope:this,
			//autoAlertSucc:false,
			beforeFitData:function(model){
				var company=this.form.findByName('CompanyId');
				var region=this.form.findByName('Region');
				var block=this.form.findByName('Block');
				var name=this.form.findByName('CommunityName');	
				var address=this.form.findByName('Address');						
				var city=this.form.findByName('CityId');
				var synchronization=this.form.findByName('Synchronization');
				if(this.form.op=='edit'){
					city.setDisable();
					company.setDisable();
					// region.setDisable();
					// block.setDisable();
					//控制是否判断非空输入			
					//name.unFormValidator(true);
					//控制是否不可修改
					//name.attr('disabled','disabled');
					//控制是否判断非空输入	
					//address.unFormValidator(true);
					//控制是否不可修改
					//address.attr('disabled','disabled');
					
					company.param.fatherid=model.CityId;
					company.reload(model.CompanyId);
					
					region.block=model.Block;
					region.area=model.CommunityBlock;
					region.param.fatherid=model.CompanyId;
					region.reload(model.Region);
					
					if (!this.form.permit.edit_permit.editall) {
                        name.attr('disabled','disabled');
                        address.attr('disabled','disabled');
                        synchronization.attr('disabled','disabled');
                    }
                    else
                    {
                        synchronization.attr('disabled','');
                    }
				}else{
					city.setEnable();
					company.setEnable();
					// region.setEnable();
					// block.setEnable();			
					name.unFormValidator(false);
					name.attr('disabled','');
					address.unFormValidator(false);
					address.attr('disabled','');
					synchronization.attr('disabled','disabled');
					company.clearItems();
					region.clearItems();
					block.clearItems();				
				}
			},
			afterGetFormJson: function(json) {
				if(json.Synchronization=='on')
				{
					json.Synchronization = true;
                }
                else
                {
                    json.Synchronization = false;
                }
            },
			saveSucc:function(data,msg){
				if(this.form.op=='edit'){
					this.reloadGrid('',this.grid.pageIndex);				
				}else{
					this.reloadGrid();
				}
				//this.createHouseBuilding();
				this.currentId=data.CommunityId;
				//this.buildIngMgr.communityId=data.CommunityId;
				//$('#addcomm_msg').jqmShow();
				Chenxin.Msg.alert.show('<a id="a-add" title="继续添加楼盘" href="#">继续添加楼盘</a> <br/><br/><a id="a-addbuilding" title="为该楼盘添加楼栋" href="#">为该楼盘添加楼栋</a><br/><br/><a id="a-bulkaddbuilding" title="批量添加楼栋" href="#">批量添加楼栋</a>','下一步',Chenxin.Msg.icon.next);				
			}
		});
	},
	createSearch:function(){
		return new Chenxin.UI.CommunityBaseInfoSearch({
			scope:this
		});
	},
	initComponent:function(){
		Chenxin.UI.CommunityMgr.superclass.initComponent.call(this);
	}
});

Chenxin.UI.CommunityBaseInfoForm = Chenxin.extend(Chenxin.UI.FormCommon, {
    actionUrl: 'service/CommunityMgr.ashx',
    id: 'communityWin',
    renderTo: 'jqm_community',
    title: '新开楼盘',
    defBBtn: true,
    initFormValidator: function() {
        var _this = this;
        //小区非空验证
        $("#txtCommunity").formValidator({
            validatorgroup: this.id,
            onshow: "请输入小区名称!",
            onfocus: "请输入小区名称!",
            oncorrect: " "
        }).inputValidator({ //非空验证
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "小区名称不能空!"
            },
            onerror: "小区名称不能空!"
        }).functionValidator({
            fun: function(val, elem) {
                var exist = false;
                var py = '';
                Chenxin.ajax({
                    type: "get",
                    dataType: "json",
                    async: false,
                    url: _this.actionUrl,
                    data: { op: 'validate_community', name: val, modelid: _this.scope.currentId, submitop: _this.op },
                    onSuccess: function(data) {
                        exist = data.exist;
                        py = data.py;
                    }
                });
                if (exist) {
                    _this.findByName('PY').val(py);
                    return true;
                } else {
                    return '小区名称已存在!';
                }
            },
            onerror: '小区名称已存在!'
        });

        //主要地址验证
        $("#txtaddress").formValidator({
            validatorgroup: this.id,
            onshow: " ",
            onfocus: " ",
            oncorrect: " "
        }).inputValidator({ //非空验证
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "主要地址不能为空!"
            },
            onerror: "主要地址不能为空!"
        }).functionValidator({
            fun: function(val, elem) {
                var exist = false;
                Chenxin.ajax({
                    type: "get",
                    dataType: "json",
                    async: false,
                    url: _this.actionUrl,
                    data: { op: 'validate_address', name: val, modelid: _this.scope.currentId, submitop: _this.op },
                    onSuccess: function(data) {
                        exist = data.exist;
                    }
                });
                if (exist) {
                    return true;
                } else {
                    if(!$('#txtaddressMsg').length){
						$('#txtaddressTip').after('<div style="float:left;padding-top:4px;" id="txtaddressMsg"></div>');
					}
                    $('#txtaddressMsg').html('主要地址已存在!');
                    return true;
                }
            },
            onerror: '主要地址已存在!'
        });
    },
    createForm: function() {
        return Chenxin.FormCommon.communityBaseInfoForm('community');
    },
    checkNeedArea: function(companyid) {
        var _this = this;
        Chenxin.ajax({
            type: "get",
            dataType: "json",
            url: this.actionUrl + '?op=checkneedarea',
            data: { companyid: companyid },
            onSuccess: function(data, msg) {
                _this.findByName('CommunityBlock').required = data.needArea;
            }
        });
    },
    createComboList: function() {
        var _this = this;

        //城市
        var city = new Chenxin.UI.StructCombo({
            param: { op: 'getcity' },
            containerId: '#community_City',
            name: 'CityId',
            inModelType: 'all',
            txtModelName: 'CityName',
            onSelected: function() {
                if (this.getValue() == this.defVal) {
                    company.clearItems();
                    region.clearItems();
                } else {
                    company.param.fatherid = this.getValue();
                    company.reload();

                    region.param.cityid = this.getValue();
                    region.reload();
                }
                block.clearItems();
                area.clearItems();
            }
        });

        //公司
        var company = new Chenxin.UI.StructCombo({
            autoLoad: false,
            param: { op: 'getcompany' },
            name: 'CompanyId',
            containerId: '#community_Company',
            inModelType: 'all',
            txtModelName: 'CompanyName',
            onSelected: function() {
                if (this.getValue() != this.defVal) {
                    _this.checkNeedArea(this.getValue());
                }
            }
        });

        var region = new Chenxin.UI.ParameterCombo({
            name: 'Region',
            containerId: '#community_Region',
            key: 'System.Region',
            inModelType: 'txt',
            required: true,
            autoLoad: false,
            afterLoadItems: function(isInit, initVal) {
                if (_this.op == 'edit') {
                    var _v = this.findValByTxt(initVal)
                    block.param.subkey = _v;
                    block.param.recordid = this.getValueRecord(_v)['id'];
                    block.reload(region.block);


                    area.param.subkey = _v;
                    area.param.recordid = this.getValueRecord(_v)['id'];
                    area.reload(region.area);
                }
            },
            onSelected: function() {
                if (this.getValue() == this.defVal) {
                    block.clearItems();
                    area.clearItems();
                } else {
                    block.param.subkey = this.getValue();
                    block.reload();

                    area.param.subkey = this.getValue();
                    area.reload();
                }

            }
        });
        var block = new Chenxin.UI.ParameterCombo({
            name: 'Block',
            containerId: '#community_Block',
            key: 'System.Block',
            inModelType: 'txt',
            autoLoad: false
        });
        var area = new Chenxin.UI.ParameterCombo({
            name: 'CommunityBlock',
            containerId: '#community_CommunityBlock',
            key: 'System.Area',
            inModelType: 'txt',
            autoLoad: false
        });

        var buildingType = new Chenxin.UI.ParameterCombo({
            containerId: '#community_BuildingType',
            name: 'BuildingType',
            key: 'Building.Type',
            inModelType: 'txt',
            autoLoad: true,
            required: true
        });

        var houseUse = new Chenxin.UI.ParameterCombo({
            containerId: '#community_CommunityUse',
            name: 'CommunityUse',
            key: 'House.Use',
            inModelType: 'txt',
            required: true
        });
        var completeYear = new Chenxin.UI.BuildingYearCombo();
        return [city, company, region, block, area, houseUse, buildingType, completeYear];
    },
    initEvent: function() {
        $("input[name='Synchronization']").live('click', function() {
           if($(this).attr("checked"))
           {
                alert("友情提示：选择同步房源，提交变更后可能会花费较长时间！");
           }
        });
        
        var _this = this;
        $('#community_Save').live('click', function() {
            _this.save();
            return false;
        });
        $('#community_Cancle').live('click', function() {
            _this.hide();
            return false;
        });
    },
    initComponent: function() {
        Chenxin.UI.CommunityBaseInfoForm.superclass.initComponent.call(this);
    }
});


Chenxin.UI.CommunityBulkAddForm=Chenxin.extend(Chenxin.UI.FormCommon,{
	actionUrl:'service/CommunityMgr.ashx',
	id:'communityBulkWin',
	renderTo:'jqm_communitybulk',
	title:'批量新开楼盘',
	defBBtn:true,
	createForm:function(){
		return Chenxin.FormCommon.communityBulkAdd(this.id);
	},
	afterGetFormJson:function(model){
		this.bulkForm.additionalParam={};
		if(model.setting=='number'){		
			this.bulkForm.additionalParam.MinNumber=model.MinNumber;
			this.bulkForm.additionalParam.MaxNumber=model.MaxNumber;
			this.bulkForm.additionalParam.LengthNumber=model.LengthNumber;
		}else{
			this.bulkForm.additionalParam.MinChar=model.MinChar;
			this.bulkForm.additionalParam.MaxChar=model.MaxChar;
			this.bulkForm.additionalParam.LengthNumber=model.LengthNumber;
		}
		this.bulkForm.additionalParam.setting=model.setting;
		if(model.step){
			this.bulkForm.additionalParam.step=model.step;
			delete model.step;
		}
		delete model.setting;
		delete model.MinChar;
		delete model.MaxChar;
		delete model.MinNumber;
		delete model.MaxNumber;
		delete model.LengthNumber;
		this.bulkForm.op='bulkadd';
	},
	createComboList:function(){
		var _this=this;		
				
		//城市
		var city=new Chenxin.UI.StructCombo({
			param:{op:'getcity'},
			containerId:'#'+this.id+'_City',
			name:'CityId',
			inModelType:'all',
			txtModelName:'CityName',
			onSelected:function(){
				if(this.getValue()==this.defVal){
					company.clearItems();
					region.clearItems();
				}else{
					company.param.fatherid=this.getValue();
					company.reload();
					
					region.param.cityid=this.getValue();
					region.reload();					
				}				
				block.clearItems();
			}
		});
		
		//公司
		var company=new Chenxin.UI.StructCombo({
			autoLoad:false,
			param:{op:'getcompany'},
			name:'CompanyId',
			containerId:'#'+this.id+'_Company',
			inModelType:'all',
			txtModelName:'CompanyName'
		});
		
		var region=new Chenxin.UI.ParameterCombo({
			name:'Region',
			containerId:'#'+this.id+'_Region',
			key:'System.Region',
			inModelType:'txt',
			required:true,
			autoLoad:false,
			afterLoadItems:function(isInit,initVal){
				if(_this.op=='edit'&&this.block){
					block.param.subkey=this.findValByTxt(initVal);
					block.param.recordid=this.getValueRecord()['id'];
					block.reload(region.block);
				}
			},
			onSelected:function(){
				if(this.getValue()==this.defVal){
					block.clearItems();
				}else{
					block.param.subkey=this.getValue();
					block.reload();				
				}
				
			}
		});
		var block=new Chenxin.UI.ParameterCombo({
			name:'Block',
			containerId: '#'+this.id+'_Block',
			key:'System.Block',
			inModelType:'txt',
			autoLoad:false
		});
		
		var buildingType=new Chenxin.UI.ParameterCombo({
			containerId:'#'+this.id+'_BuildingType',
			name:'BuildingType',
			key:'Building.Type',
			inModelType:'txt',			
			autoLoad:true,
			required:true				
		});
		
		var houseUse=new Chenxin.UI.ParameterCombo({
			containerId: '#'+this.id+'_CommunityUse',
			name: 'CommunityUse',
			key:'House.Use',
			inModelType:'txt',
			required:true	
		});
		var completeYear=new Chenxin.UI.BuildingYearCombo({
			containerId: '#'+this.id+'_CompleteYear'
			
		});
		return [city,company,region,block,houseUse,buildingType,completeYear];
	},
	initEvent:function(){
				
		var _this=this;
		$('#'+this.id+'_Save').live('click',function(){
			_this.save();
		});
		$('#'+this.id+'_Cancle').live('click',function(){
			_this.hide();
		});	
	},
	initComponent:function(){
		Chenxin.UI.CommunityBulkAddForm.superclass.initComponent.call(this);
	}
});

/**
*查询面板
*/
Chenxin.UI.CommunityBaseInfoSearch=Chenxin.extend(Chenxin.UI.SearchCommon,{
	id:'community_search',
	initEvent:function(){
		var _this=this;
		$('#btn_search').live('click',function(){
			_this.scope.reloadGrid();
		});
		
		
        //小区自动填充
        $('#txtHousing').autocomplete({
            deferRequestBy: 5,
			width:270,
            serviceUrl: 'service/HouseMgr.ashx?op=loadcommunity'
        });
	},
	createComboList:function(){	
		
		//城市
		var city=new Chenxin.UI.StructCombo({
			param:{op:'getcity'},
			containerId:'#community_SearchCity',
			name:'cityid',
			tbxWidth:70,
			afterLoadItems:function(){
				if(this.items.length==1){
					this.addPleaseSelected=false;
					this.defVal=this.items[0].val;
					this.defTxt=this.items[0].txt;
					company.param.fatherid=this.defVal;
					company.reload();
				}else{
					this.addPleaseSelected=true;
					this.defVal='请选择';
					this.defTxt='请选择';				
				}
			},
			onSelected:function(){
				if(this.getValue()==this.defVal){
					company.clearItems();
					
					region.clearItems();
				}else{					
					company.param.fatherid=this.getValue();
					company.reload();
					
					region.param.cityid=this.getValue();
					region.reload();
				}
				block.clearItems();
			}
		});
		
		//公司
		var company=new Chenxin.UI.StructCombo({
			autoLoad:false,
			param:{op:'getcompany'},
			name:'companyid',
			containerId:'#community_SearchCompany',
			tbxWidth:70,
			afterLoadItems:function(){
				if(this.items.length==1){
					this.addPleaseSelected=false;
					this.defVal=this.items[0].val;
					this.defTxt=this.items[0].txt;
				}else{
					this.addPleaseSelected=true;
					this.defVal='请选择';
					this.defTxt='请选择';							
				}
			}
		});
		
		var region=new Chenxin.UI.ParameterCombo({
			name:'region',
			containerId:'#community_SearchRegion',
			key:'System.Region',
			tbxWidth:70,
			inModelType:'txt',
			onSelected:function(){
				block.param.subkey=this.getValue();
				block.param.recordid=this.getValueRecord()['id'];
				block.reload();
			}
		});
		var block=new Chenxin.UI.ParameterCombo({
			containerId: '#community_SearchBlock',
			name:'block',
			key:'System.Block',
			tbxWidth:70,
			inModelType:'txt',
			autoLoad:false
		});
		var status=new Chenxin.UI.Combo({
			containerId: '#community_SearchStatus',
			name:'status',
			tbxWidth:70,
			items:[{txt:'未删除',val:'1,-10'},{txt:'正常',val:'1'},{txt:'已冻结',val:'-10'},{txt:'已删除',val:'-1'}]
		});
		return [city,company,region,block,status];
	},
	initComponent:function(){
		Chenxin.UI.CommunityBaseInfoSearch.superclass.initComponent.call(this);
	}
});


/**
*@description 楼盘DIV
*@method 提交按钮的处理方法
*/
Chenxin.FormCommon.communityBaseInfoForm=function(comboIdPrefix){
        return '<table class="tbl_f"><tbody><tr><th style="width:100px;"><span class="isfilled">*</span>楼盘名称：</th><td><input type="text" style="width: 120px;" value="" class="inputbox_n fl" name="CommunityName" id="txtCommunity" /><div id="txtCommunityTip" style="float:left; margin-left: 5px; width: 93px; height: 26px; line-height: 26px; text-align: left;"></div></td><th style="width:100px;">同步房源：</th><td><input type="checkbox" id="Synchronization" name="Synchronization"/></td></tr><tr><th style="width:100px;">拼音：</th><td><input type="text" style="width: 120px;" value="" class="inputbox_n fl" name="PY" id="txtPY" /></td><th> 建筑年代：</th><td><div id="' + comboIdPrefix + '_CompleteYear" style="z-index:909;margin-right: 5px;" class="SelectWrapSingle validator"></div></td></tr><tr><th><span class="isfilled">*</span>城市：</th><td><div id="' + comboIdPrefix + '_City" style="z-index:906; margin-right: 5px;" class="SelectWrapSingle validator"></div></td><th style="width:100px;"><span class="isfilled">*</span>公司：</th><td><div id="' + comboIdPrefix + '_Company" style="z-index:905;margin-right: 5px;" class="SelectWrapSingle validator"></div></td></tr><tr><th><span class="isfilled">*</span>区域：</th><td><div id="' + comboIdPrefix + '_Region" style="z-index:904; margin-right: 5px;" class="SelectWrapSingle validator"></div></td><th>板块：</th><td><div id="' + comboIdPrefix + '_Block" style="z-index:903;margin-right: 5px;" class="SelectWrapSingle validator"></div></td></tr><tr><th>片区：</th><td colspan="3"><div id="' + comboIdPrefix + '_CommunityBlock" style="z-index:903;margin-right: 5px;" class="SelectWrapSingle validator"></div></td></tr><tr><th><span class="isfilled">*</span>用途：</th><td><div id="' + comboIdPrefix + '_CommunityUse" style="z-index:902;margin-right: 5px;" class="SelectWrapSingle validator"></div></td><th><span class="isfilled">*</span>类型：</th><td><div id="' + comboIdPrefix + '_BuildingType" style="z-index:901;margin-right: 5px;" class="SelectWrapSingle validator"></div></td></tr><tr><th><span class="isfilled">*</span>主要地址：</th><td colspan="3"><input type="text" style="width: 340px;" value="" class="inputbox_n fl" id="txtaddress" name="Address" /><div id="txtaddressTip" style="float:left; margin-left: 5px; height: 26px; line-height: 26px; text-align: left;"></div></td></tr><tr><th>备用地址1：</th><td colspan="3"><input type="text" style="width: 340px;" value="" class="inputbox_n" id="txtaddress1" name="Address2" /></td></tr><tr><th>备用地址2：</th><td colspan="3"><input type="text" style="width: 340px;" value="" class="inputbox_n" id="txtaddress2" name="Address3" /></td></tr><tr><th>备用地址3：</th><td colspan="3"><input type="text" style="width: 340px;" value="" class="inputbox_n" id="txtaddress3" name="Address4" /></td></tr><tr><th>学校：</th><td colspan="3"><textarea id="school" name="Schools" cols="80" rows="3" class="textarea_n" style="width: 480px; height: 20px; padding:5px;"></textarea></td></tr><tr><th>公园：</th><td colspan="3"><textarea id="park" name="Parks" cols="80" rows="3" class="textarea_n" style="width: 480px; height: 20px; padding:5px;"></textarea></td></tr><tr><th>交通：</th><td colspan="3"><textarea id="traffic" name="Traffics" cols="80" rows="3" class="textarea_n" style="width: 480px; height: 20px; padding:5px;"></textarea></td></tr><tr><th>房源描述：</th><td colspan="3"><textarea id="remark" name="Description" cols="80" rows="3" class="textarea_n" style="width: 480px; height: 20px; padding:5px;"></textarea><input type="hidden" name="CommunityId"/><input type="hidden" name="Status"/></td></tr></tbody></table>'
}


/**
*@description 楼盘DIV
*@method 提交按钮的处理方法
*/
Chenxin.FormCommon.communityBulkAdd=function(comboIdPrefix){
        return '<table class="tbl_f"><tbody><th style="width:100px;"><span class="isfilled">*</span>楼盘名称：</th><td colspan="3"><input type="text" style="width: 120px;" value="" class="inputbox_n fl" name="CommunityName" /> <span class="isfilled">通配符将替换"(*)"</span></td></tr><tr><th>步长：</th><td><input type="text" class="inputbox_n" name="step" value="1"  style="width:120px" /></td></tr><tr><th></th><td>楼栋名称通配符设置：</td></tr><tr><tr><th></th><td colspan="3"><input type="radio" name="setting" class="lineh15" checked="checked" value="number"/> 从 <input type="text" class="inputbox_n"  style="width:30px" name="MinNumber" value="1" /> 到 <input type="text" class="inputbox_n" style="width:30px" name="MaxNumber" value="1" /> 长度 <input type="text" class="inputbox_n" name="LengthNumber" value="1" maxlength="1"   style="width:30px"/>(1-5) </td></tr><tr><th></th><td colspan="3"><input type="radio" name="setting" class="lineh15" value="char"/> 从 <input type="text" class="inputbox_n"  style="width:30px" name="MinChar" value="A" /> 到 <input type="text" class="inputbox_n" style="width:30px" name="MaxChar" value="Z" /></td></tr><tr><th> 建筑年代：</th><td colspan="3"><div id="' + comboIdPrefix + '_CompleteYear" style="z-index:909;margin-right: 5px;" class="SelectWrapSingle validator"></div></td></tr><th style="width:100px;"><span class="isfilled">*</span>城市：</th><td><div id="' + comboIdPrefix + '_City" style="z-index:906; margin-right: 5px;" class="SelectWrapSingle validator"></div></td><th><span class="isfilled">*</span>公司：</th><td><div id="' + comboIdPrefix + '_Company" style="z-index:905;margin-right: 5px;" class="SelectWrapSingle validator"></div></td></tr><tr><th><span class="isfilled">*</span>区域：</th><td><div id="' + comboIdPrefix + '_Region" style="z-index:904; margin-right: 5px;" class="SelectWrapSingle validator"></div></td><th><span class="isfilled">*</span>板块：</th><td><div id="' + comboIdPrefix + '_Block" style="z-index:903;margin-right: 5px;" class="SelectWrapSingle validator"></div></td></tr><tr><th><span class="isfilled">*</span>用途：</th><td><div id="' + comboIdPrefix + '_CommunityUse" style="z-index:902;margin-right: 5px;" class="SelectWrapSingle validator"></div></td><th><span class="isfilled">*</span>类型：</th><td><div id="' + comboIdPrefix + '_BuildingType" style="z-index:901;margin-right: 5px;" class="SelectWrapSingle validator"></div></td></tr><tr><th><span class="isfilled">*</span>主要地址：</th><td colspan="3"><input type="text" style="width: 340px;" value="" class="inputbox_n fl" name="Address" /> <span class="isfilled">通配符将替换"(*)"</span></td></tr><tr><th>备用地址1：</th><td colspan="3"><input type="text" style="width: 340px;" value="" class="inputbox_n" id="txtaddress1" name="Address2" /></td></tr><tr><th>备用地址2：</th><td colspan="3"><input type="text" style="width: 340px;" value="" class="inputbox_n" id="txtaddress2" name="Address3" /></td></tr><tr><th>备用地址3：</th><td colspan="3"><input type="text" style="width: 340px;" value="" class="inputbox_n" id="txtaddress3" name="Address4" /></td></tr><tr><th>学校：</th><td colspan="3"><textarea id="school" name="Schools" cols="80" rows="3" class="textarea_n" style="width: 480px; height: 20px; padding:5px;"></textarea></td></tr><tr><th>公园：</th><td colspan="3"><textarea id="park" name="Parks" cols="80" rows="3" class="textarea_n" style="width: 480px; height: 20px; padding:5px;"></textarea></td></tr><tr><th>交通：</th><td colspan="3"><textarea id="traffic" name="Traffics" cols="80" rows="3" class="textarea_n" style="width: 480px; height: 20px; padding:5px;"></textarea></td></tr><tr><th>房源描述：</th><td colspan="3"><textarea id="remark" name="Description" cols="80" rows="3" class="textarea_n" style="width: 480px; height: 20px; padding:5px;"></textarea><input type="hidden" name="PY"/></td></tr></tbody></table>'
}





















